﻿@model Eqwww.Domain.Models.SystemManage.StrategoryModel
@inject  Eqwww.App.Identity.UserApp UserApp

@{
    ViewData["Title"] = "Details";
    Layout = "~/Views/Shared/_ManageFormLayout.cshtml";
}

<div class="mdui-m-t-3"></div>
<div class="mdui-container">
    <div class="mdui-row">
        <div class="mdui-col-sm-12 mdui-col-md-6 ">
            <div class="mdui-typo-title mdui-p-a-2">基本信息</div>
            <div class="mdui-list">
                <div class="mdui-list-item mdui-ripple">
                    <div class="mdui-list-item-content">
                        <div class="mdui-list-item-text ">@Html.DisplayNameFor(model => model.Name)</div>
                        <div class="mdui-list-item-title">@Html.DisplayFor(model => model.Name)</div>
                    </div>

                </div>
                <div class="mdui-list-item mdui-ripple">
                    <div class="mdui-list-item-content">
                        <div class="mdui-list-item-text">@Html.DisplayNameFor(model => model.Code)</div>
                        <div class="mdui-list-item-title">@Html.DisplayFor(model => model.Code)</div>
                    </div>

                </div>
                <div class="mdui-list-item mdui-ripple">
                    <div class="mdui-list-item-content">
                        <div class="mdui-list-item-text">@Html.DisplayNameFor(model => model.IsSystem)</div>
                        <div class="mdui-list-item-title">
                            @if (Model.IsSystem == true)
                            {
                                <text>是</text>
                            }
                            else
                            {
                                <text>否</text>
                            }
                        </div>
                    </div>

                </div>
                <div class="mdui-list-item mdui-ripple">
                    <div class="mdui-list-item-content">
                        <div class="mdui-list-item-text">@Html.DisplayNameFor(model => model.IsSuper)</div>
                        <div class="mdui-list-item-title">
                            @if (Model.IsSuper == true)
                            {
                                <text>是</text>
                            }
                            else
                            {
                                <text>否</text>
                            }
                        </div>
                    </div>

                </div>
                <div class="mdui-list-item mdui-ripple">
                    <div class="mdui-list-item-content">
                        <div class="mdui-list-item-text">@Html.DisplayNameFor(model => model.Description)</div>
                        <div class="mdui-list-item-title">@Html.DisplayFor(model => model.Description)</div>
                    </div>

                </div>
                <div class="mdui-list-item mdui-ripple">
                    <div class="mdui-list-item-content">
                        <div class="mdui-list-item-text">@Html.DisplayNameFor(model => model.SortCode)</div>
                        <div class="mdui-list-item-title">@Html.DisplayFor(model => model.SortCode)</div>
                    </div>

                </div>
            </div>

           


            <div class="mdui-typo-title mdui-p-a-2">关联角色</div>
            <div class="mdui-p-l-2 mdui-p-r-2 mdui-p-b-4">
                @{ 
                    var relatedRoles = ViewBag.RelatedRoles as IEnumerable<Eqwww.Domain.Models.Identity.RoleModel>;
                }
                @if (relatedRoles.Count() > 0)
                {
                @foreach (var item in relatedRoles)
                {
                    <div class="mdui-chip">
                        <span class="mdui-chip-icon">@item.Name.Substring(0, 1).ToUpper()</span>
                        <span class="mdui-chip-title">@item.ShowName</span>
                    </div>

                }
                }
                else
                {
                    <p class="mdui-text-color-theme-accent">本策略未关联任何角色</p>
                }
            </div>
            
        </div>

       
        <div class="mdui-col-xs-12 mdui-col-md-6">
           
            <div class="mdui-typo-title mdui-p-a-2">关联权限</div>
            <div class="mdui-p-l-2 mdui-p-r-2 mdui-p-b-4">
                @if (Model.IsSuper == true)
                {
                    <div class="mdui-text-color-theme">超管策略拥有全部权限</div>
                }
                else
                {
                    <tree-collapse-toggle items="@ViewBag.Items" class="mdui-list" mdui-collapse></tree-collapse-toggle>
                }

            </div>
        </div>
       
    </div>
</div>

